package com.cn.xiaonuo.tcrfinance.tcrusers.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cn.xiaonuo.tcrfinance.tcrusers.entity.PvWalletLog;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Repository
public interface PvWalletLogMapper extends BaseMapper<PvWalletLog> {
    //价钱或者减钱
    Integer updateWalletInfoByUserId(@Param("userId") Integer userId,@Param("money") BigDecimal money,@Param("types")Integer types);

    //插入资金变化日志
    Integer insertWalletLogByUserId(@Param("userId") Integer userId,
                                    @Param("oderId") Integer oderId,
                                    @Param("money") BigDecimal money,
                                    @Param("remarks") String remarks,
                                    @Param("createTime") String createTime,
                                    @Param("types")Integer types,
                                    @Param("loginUserId")Integer loginUserId);


    /**
     * 查询汇付天下钱包信息列表
     *
     * @return
     */
    List<Map<String, Object>> queryWalletList(@Param("slUserId") Integer slUserId);





    /**
     * 统计当天商品购买总量
     *
     * @return
     */
    List<Map<String, Object>> queryUserProductList();


    List<Map<String, Object>> queryRefund(@Param("orderId") Integer orderId);

    /**
     *
     * @param poundageUserId
     * @param curTime
     * @return
     */
    Double totalPoundageSum(@Param("poundageUserId") Integer poundageUserId,
                          @Param("curTime") String curTime);

    BigDecimal getAccountBalances(@Param("date") String date,@Param("userId") Integer userId);
}
